/*
 * A.cpp
 *
 *  Created on: 2014-2-12
 *      Author: cjrzh
 */

#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<algorithm>

using namespace std;
int n,x,y;
bool v[110],h[110];
int main()
{
	memset(v,0,sizeof(v));
	memset(h,0,sizeof(h));
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d",&x,&y);
		h[x]=1;
		v[y]=1;
	}
	int a=0,b=0;
	for(int i=0;i<=100;i++)
	{
		a+=v[i];
		b+=h[i];
	}
	printf("%d\n",min(a,b));
	return 0;
}
